<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <title>销售机会管理</title>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
</head>
<body>
<div class="container">
  <h1>销售机会管理</h1>

  <!-- 销售机会列表部分 -->

  <table class="table">
    <thead>
    <tr>
      <th>客户名称</th>
      <th>交易金额</th>
      <th>预计成交日期</th>
      <th>销售阶段</th>
      <th>销售人员</th>
      <th>备注</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="opportunity : ${opportunities}">
      <td th:text="${opportunity.client.name}">客户名称</td>
      <td th:text="${opportunity.amount}">交易金额</td>
      <td th:text="${opportunity.expectedCloseDate}">预计成交日期</td>
      <td th:text="${opportunity.stage}">销售阶段</td>
      <td th:text="${opportunity.salesPerson}">销售人员</td>
      <td th:text="${opportunity.note}">备注</td>
    </tr>
    </tbody>
  </table>

  <!-- 销售机会录入表单部分 -->
  <h2>新增销售机会</h2>
  <form th:action="@{/opportunities/manage}" method="post">
    <div class="form-group">
      <label for="clientId">客户ID：</label>
      <input type="number" id="clientId" name="clientId" class="form-control" required>
    </div>
    <div class="form-group">
      <label for="amount">交易金额：</label>
      <input type="number" id="amount" name="amount" class="form-control" step="0.01" required>
    </div>
    <div class="form-group">
      <label for="expectedCloseDate">预计成交日期：</label>
      <input type="date" id="expectedCloseDate" name="expectedCloseDate" class="form-control">
    </div>
    <div class="form-group">
      <label for="stage">销售阶段：</label>
      <input type="text" id="stage" name="stage" class="form-control" required>
    </div>
    <div class="form-group">
      <label for="status">销售状态：</label>
      <input type="text" id="status" name="status" class="form-control" required>
    </div>
    <div class="form-group">
      <label for="salesPerson">销售人员：</label>
      <input type="text" id="salesPerson" name="salesPerson" class="form-control" required>
    </div>
    <div class="form-group">
      <label for="note">备注：</label>
      <textarea id="note" name="note" class="form-control"></textarea>
    </div>
    <button type="submit" class="btn btn-primary">提交</button>
  </form>
</div>
</body>
</html>
